﻿package com.addcn.common.data 
{	
	import fl.transitions.easing.Strong;
	/**
	 * 遊戲全局遍量類
	 * @author lmzd
	 */
	public class Global extends Object
	{		
		public static var GAME_NAME:String = "德州撲克";  //遊戲名稱
		private  var  _xml_url : String = "startupLoad.xml"; //xml配置文件			
		private var _version:String = "1.0.0";      //遊戲版本，程序根據該版本號加載xml			
		private var _photo_url : String;  //頭像地址		
		private var _debug:Boolean = false; //遊戲模式								
		private static var _instance:Global;
		
		public function Global() 
		{
			if ( _instance != null ) {
				trace("Glode init error");
			}
			return;
		}
		
		public static function getInstance():Global {
			if ( _instance == null ) {
				_instance = new Global();
			}
			return _instance
		}
		
		public function get xmlUrl() : String
		{
			if (_version != "1.0.0") {
				var _str : String = _xml_url + "?v=" + _version;
				return _str;
			}
			return this._xml_url;
		}
		
		/**
		 * 設置游戲版本號
		 * @param	param
		 */
		public function set version(r_data:String):void {
			if(r_data != null){
				this._version = r_data;
			}
		}
		public function get version() : String {			
			return this._version;
		}
		
		/**
		 *頭像地址
		 */
		public function set photoUrl(r_url : String) : void
		{	
			_photo_url = r_url;			
		}
		public function get photoUrl() : String
		{
			if (_photo_url == null) return  "";
			return _photo_url;
		}
		
		/**
		 * 記錄是否是在debug環境下
		 */
		public function get debug():Boolean {
			return _debug;
		}
		
		public function set debug(r_bool : Boolean) {
			this._debug = r_bool;
		}
		
	}

}
